﻿using System;

namespace Program13
{
    class Program
    {
        //const是静态常量，所以在编译的时候就将A与B的值确定下俩了
        //static readonly是动态常量，常量在编译期间不断解析，所以开始都是默认值，X与Y都是int类型，故都是0
        //而在程序执行带X=Y*10,所以X=0*10=0,程序接着执行到Y=10这句话是，才会真正的Y的初值10赋给Y
        static readonly int X = Y * 10;
        static readonly int Y = 10;

        static void Main(string[] args)
        {
            //var num = 10;
            //num = 20;
            //Console.WriteLine("输出变量:" + num);
            //const int num1= 30;//在运行过程中不能进行改变
            //Console.WriteLine("输出常量：" + num1);

            Console.WriteLine("X is {0},Y is {1}", X, Y);

            const int B = 10;
            const int A = B * 10;
            Console.WriteLine("A is {0},B is {1}", A, B);
        }
    }
}
